﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Project.UserControls
{
    public partial class SingleSpeler_UserControl : UserControl
    {
        private bool isBot;
        private Color color;

        private Spelers_UserControl suc;

        public SingleSpeler_UserControl(string naam, Color color, Spelers_UserControl suc)
        {
            InitializeComponent();
            this.naam_textBox.Text = naam;
            this.isBot = true;
            this.color = color;
            this.kleur_panel.BackColor = this.color;
            this.suc = suc;
        }

        // Get Naam
        public string getNaam()
        {
            return naam_textBox.Text;
        }

        public object getMoeilijkheid()
        {
            return Moeilijkheid_combobox.SelectedIndex;
        }

        private void isBot_checkBox_CheckedChanged(object sender, EventArgs e)
        {
            this.isBot = !this.isBot;
            Moeilijkheid_combobox.Visible = !Moeilijkheid_combobox.Visible;
            if (Moeilijkheid_combobox.Visible)
            {
                Moeilijkheid_combobox.SelectedIndex = 0;
            }
        }

        private void colorDialog_button_Click(object sender, EventArgs e)
        {
            if (colorDialog.ShowDialog() == DialogResult.OK)
            {
                this.color = colorDialog.Color;
                this.kleur_panel.BackColor = this.color;
            }
        }

        // IsBot Property
        public bool IsBot
        {
            get { return isBot; }
            set { isBot = value; }
        }

        // Color Property
        public Color Color
        {
            get { return color; }
            set { color = value; }
        }

        private void verwijder_button_Click(object sender, EventArgs e)
        {
            this.suc.removePanel(this);
        }

        private void Moeilijkheid_combobox_SelectedIndexChanged(object sender, EventArgs e)
        {

        }
    }
}
